import 'package:flutter/material.dart';
import 'package:ost_flutter_module/common/adapt.dart';
import 'package:ost_flutter_module/common/color.dart';

class LoadingWidget extends StatelessWidget {
  final Color backgroundColor;

  const LoadingWidget({Key key, this.backgroundColor = Colors.white})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      width: double.infinity,
      height: double.infinity,
      color: backgroundColor,
      child: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            SizedBox(
              width: Adapt.px(20),
              height: Adapt.px(20),
              child: CircularProgressIndicator(strokeWidth: 2),
            ),
            SizedBox(height: 16.0),
            Text("加载中...",
                style: TextStyle(color: color666666, fontSize: Adapt.px(14)))
          ],
        ),
      ),
    );
  }
}
